const chalk = require('chalk'); // 为控制台输出的文字着色
const symbols = require('log-symbols'); // 终端图标显示

module.exports = function log(type, msg, stop=false){
     
    let colors = {
        success: 'green', 
        info: 'blue', 
        warn: 'yellow', 
        error: 'red'
    }
    console.log(symbols[type], chalk[colors[type]](`${type} ${msg}`));
    stop===true && process.exit(1)
    
}